package com.skyhigh.web.webservice.validators;

import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;

import com.skyhigh.web.webservice.domain.Usuario;

public class LoginValidator implements Validator {
	
	public boolean supports(Class aClass) {
		return Usuario.class.equals(aClass);
	}
 
	public void validate(Object obj, Errors errors) {		
 
		ValidationUtils.rejectIfEmptyOrWhitespace(errors, "idUsuario", "field.required", "*");
 
		ValidationUtils.rejectIfEmptyOrWhitespace(errors, "password", "field.required", "*");
	
	}

}
